#!/usr/bin/python2.7

class Project:
        def  __init__(self, name, configs):
            self.name = name
            self.configurations = configs
            
        def getName(self):
            return self.name
            
        def __str__(self):
            return self.name
            
        def getConfigurations(self):
            return self.configurations
            
        def compile(self):
            """ MSBuild compiler command compiles the project with the configuration "config_name" """           
            errors = []
            for config in self.configurations:
                cmd = "MSBuild.exe \"" + self.name + "\" /p:Configuration=" + config + " /m:4"
                errors = executeCommand(cmd)
                if len(errors) > 0:
                    return errors
            return []    
                
            
        def clean(self):
            """ Cleans the project "project" with the configuration "config_name" """
            errors = []
            for config in self.configurations:
                cmd = "MSBuild.exe \"" + self.name + "\" /p:Configuration=" + config + " /t:Clean /m:4"
                errors = executeCommand(cmd)
                if len(errors) > 0:
                    return errors
            return []
            
        def toXml(self):
            xml = "<project>"
            xml += "<name>"+self.name+"</name>"
            xml += "</project>"
